<?php

/**
 * BlogLink form.
 *
 * @package    HugoHamon
 * @subpackage form
 * @author     Hugo Hamon <hugo.hamon@sensio.com>
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class BlogLinkForm extends BaseBlogLinkForm
{
  public function configure()
  {
    $this->useFields(array(
      'name', 'lang', 'uri', 'is_published'  
    ));
    
    $this->widgetSchema['lang'] = new sfWidgetFormI18nChoiceLanguage();
    $this->widgetSchema['name']->setAttribute('size', '50');
    $this->widgetSchema['uri']->setAttribute('size', '80');
    
    $this->validatorSchema['lang'] = new sfValidatorI18nChoiceLanguage(
      array(),
      array('invalid' => 'Choosen language is not a valid language value.')
    );
    
    $this->validatorSchema['uri'] = new sfValidatorUrl(
      array(),
      array('invalid' => 'This is not a valid URI.')
    );

    $this->widgetSchema->setHelp('name', "The link name, generally the page's title.");
    $this->widgetSchema->setHelp('lang', "The language of the page's content.");
    $this->widgetSchema->setHelp('uri', 'The full valid URI of the page.');
    $this->widgetSchema->setHelp('is_published', 'Tick the box to publish the link.');
  }
}
